using System.Threading;

namespace LP
{
    public class CancelTokenPattern : ILifecycle
    {
        protected CancellationTokenSource TokenSource = new CancellationTokenSource();

        public virtual void OnInit()
        {

        }

        public virtual void OnDestroy()
        {
            TokenSource.Cancel();
            Global.CancleTokenMgrIns.OnCancleTokenNotify();
            TokenSource.Dispose();
        }

        public virtual void OnInitFinish()
        {
        }
    }
}